package cn.zhc.com.utils;

import java.net.URLDecoder;
import java.net.URLEncoder;

/**
 * Created by zhouhongchun on 2017/8/14.
 */

public class UtilsUrlEncode {

    public static String urlEncode(String text) {
        try {
            text = URLEncoder.encode(text, "UTF-8");
        } catch (Exception e) {
            e.printStackTrace();
        }

        return text;
    }
    public static String URLDecode(String text) {
        try {
            text = URLDecoder.decode(text, "UTF-8");
        } catch (Exception e) {
            e.printStackTrace();
        }

        return text;
    }
}
